﻿using Iworld.Author.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace Iworld.Author.Service.Backstage.Export
{
    /// <summary>
    /// 提现记录
    /// </summary>
    [DataContract]
    public class WithdrawalsRecordExport
    {

        public WithdrawalsRecordExport(WithdrawalsRecord record)
        {
            this.Id = record.Id;
            this.Owner = new AuthorExport(record.Owner);
            this.Golds = record.Golds;
            this.Status = record.Status;
            this.Remark = record.Remark;
            this.Account = record.Account;
            this.Bank = record.Bank;
            this.Person = record.Person;
            IsEdited = this.Status == WithdrawalsStatus.处理中;
            this.CreatedTime = record.CreatedTime;
        }

        [DataMember]
        public int Id { set; get; }

        /// <summary>
        /// 申请人
        /// </summary>
        [DataMember]
        public AuthorExport Owner { get; set; }

        /// <summary>
        /// 提现金币数量
        /// </summary>
        [DataMember]
        public double Golds { set; get; }

        /// <summary>
        /// 账号
        /// </summary>
        [DataMember]
        public string Account { get; set; }

        /// <summary>
        /// 银行
        /// </summary>
        [DataMember]
        public string Bank { set; get; }

        /// <summary>
        /// 开户人
        /// </summary>
        [DataMember]
        public string Person { set; get; }

        /// <summary>
        /// 当前状态
        /// </summary>
        [DataMember]
        public WithdrawalsStatus Status { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [DataMember]
        public string Remark { set; get; }

         [DataMember]
        public bool IsEdited { set; get; }

         [DataMember]
        public DateTime CreatedTime { set; get; }

    }
}
